<template>
  <div class="app-container">
      <h2 style="text-align: center;">发布新课程</h2>
      <el-steps :active="1" process-status="wait" align-center style="margin-bottom: 40px;">
        <el-step title="填写课程基本信息"/>
        <el-step title="创建课程大纲"/>
        <el-step title="提交审核"/>
      </el-steps>
      <el-form label-width="120px"  :model="courseInfo" :rules="dataRule" ref="courseInfo" >
        <el-form-item label="课程标题" prop="title">
        <el-input v-model="courseInfo.title" placeholder=" 示例：机器学习项目课：从基础到搭建项目视频课程。专业名称注意大小写" />
      </el-form-item>

      <!-- 所属分类 TODO -->



      <!-- 课程讲师 TODO -->
      <!-- 课程讲师 -->
      <el-form-item label="课程所属专业" prop="subjectId">
        <dept :id="courseInfo.subjectId"  v-if="flag"  @add="addDpe" ></dept>
      </el-form-item>

      <el-form-item label="总课时" prop="lessonNum">
        <el-input-number :min="0" v-model="courseInfo.lessonNum" controls-position="right" placeholder="请填写课程的总课时数" />
      </el-form-item>

      <!-- 课程简介-->
      <!-- 课程简介-->
      <el-form-item label="课程简介" prop="description">
            <editor :commits = "courseInfo.description"  v-if="flag"  @func="getMsgFormSon"></editor>
      </el-form-item>

      <!-- 课程封面 TODO -->
      <!-- 课程封面-->
      <el-form-item label="课程封面" style="margin-top: 80px;" prop="cover">
        <SingleUpload v-model="courseInfo.cover"></SingleUpload>
      </el-form-item>
      <el-form-item label="课程价格" prop="price">
        <el-input-number :min="0" v-model="courseInfo.price" controls-position="right" placeholder="免费课程请设置为0元" /> 元
      </el-form-item>

      <el-form-item>
        <el-button :disabled="saveBtnDisabled" type="primary" @click="saveOrUpdate">保存并下一步</el-button>
      </el-form-item>
    </el-form>
    </div>
</template>